import akshare as ak
import sys
# 北向资金余额
# (“沪股通”, “深股通”, “北上”)


def stock_em_hsgt_north_cash(code):
    stock_em_hsgt_north_cash = ak.stock_em_hsgt_north_cash(indicator=code)
    for indexs in stock_em_hsgt_north_cash.index:
        s = ''
        index = stock_em_hsgt_north_cash.loc[indexs]
        for i in range(index.size):
            s = s + str(index[i])
            if i != index.size - 1:
                s = s + ","
        print(s)



if __name__ == '__main__':
    for i in range(1, len(sys.argv)):
        url = sys.argv[i]
        stock_em_hsgt_north_cash(url)